import axiosHttp from "../../http"

function userInfo() {
  return axiosHttp.post("/userInfo") //这里的  '/userInfo'  是具体的接口后面的名称  例如:http://127.0.0.1/api/userInfo
}
// 获取picker值
async function getPicker(data) {
  return axiosHttp({
    url: "/my/getpicker",
    method: "get",
    data,
  }).then((res) => {
    return res
  })
}

// 检查是否进行校园认证成功
async function isCheck(data) {
  return axiosHttp({
    url: "/my/ischeck",
    method: "get",
    data,
  }).then((res) => {
    return res
  })
}

// 多张图片上传
async function uploadPics(data) {
  console.log(data)
  return axiosHttp({
    url: "/my/uploadpics",
    method: "post",
    data,
  }).then((res) => {
    return res
  })
}

// 上传商品
async function uploadShops(data) {
  console.log(data)
  return axiosHttp({
    url: "/my/uploadshops",
    method: "post",
    data,
  }).then((res) => {
    return res
  })
}

// 上传商品1.0
async function uploadShopsMsg(data) {
  console.log(data)
  return axiosHttp({
    url: "/my/uploadshopsmsg",
    method: "post",
    data,
  }).then((res) => {
    return res
  })
}

// 获取在线商品
async function getOnlineShop(data) {
  console.log(data)
  return axiosHttp({
    url: "/my/getonlineshop",
    method: "get",
    data,
  }).then((res) => {
    return res
  })
}

// 下架商品
async function offSelf(data) {
  console.log(data)
  return axiosHttp({
    url: "/my/offself",
    method: "post",
    data,
  }).then((res) => {
    return res
  })
}

// 获取审核token的方法
async function getExamineToken(data) {
  console.log(data)
  return axiosHttp({
    url: "/my/getexaminetoken",
    method: "get",
    data,
  }).then((res) => {
    return res
  })
}

// 文字审核
async function examineWord(data) {
  console.log(data)
  return axiosHttp({
    url: "/my/examineword",
    method: "post",
    data,
  })
}

// 图片审核
async function examinePic(data) {
  console.log(data)
  return axiosHttp({
    url: "/my/examinepic",
    method: "post",
    data,
  })
}

// 校园认证
async function examinCheck(data) {
  console.log(data)
  return axiosHttp({
    url: "/my/examincheck",
    method: "get",
    data,
  })
}

export default {
  getPicker,
  isCheck,
  uploadPics,
  uploadShops,
  uploadShopsMsg,
  getOnlineShop,
  offSelf,
  getExamineToken,
  examineWord,
  examinePic,
  examinCheck,
}
